package com.my.aslife.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.my.aslife.module.entity.Task;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author mayuan
 * @description TODO
 */
public interface TaskMapper extends BaseMapper<Task> {

    @Select("select * from task where status = #{status} limit #{current}, #{size}")
    List<Task> listByPage(@Param("current") Integer current, @Param("size") Integer size, @Param("status") Integer status);

    @Update("update task set task_id = #{taskId} , status = #{status} where task_id = #{taskId}")
    void updateTask(@Param("status") Integer status, @Param("taskId") Long taskId);

    void deleteDemandByTaskId(String addressKey);
}
